import { Prisma } from '@prisma/client';
import { BaseQueryDto } from './base.dto';
import { IsDefined } from 'class-validator';

export class OrderQueryDto extends BaseQueryDto<
  Prisma.OrderWhereUniqueInput & {
    realname?: string;
    mobile?: string;
    startTime?: string;
    endTime?: string;
  }
> {}

export class OrderListDto extends BaseQueryDto<
  Prisma.OrderWhereUniqueInput & {
    assetTitle?: string;
    startTime?: string;
    endTime?: string;
  }
> {
  userId: number;
}

export class OrderPayDto {
  @IsDefined({ message: '订单号必填' })
  no: string;

  @IsDefined({ message: '密码必填' })
  pass: string;
}
